static char SccsId[] = "@(#)aslzoom.c	1.5   10/6/95";
/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */

#define	_ASLLIB_
#define	_ASLZOOM_C_

#include <farl.h>
#include <asl.h>

/*----------------------------------------------------------------------------*/
void
ASLMakeZoomSprite( ASLSource *src,
	short dstX,	short dstY,	short scale,	ASLSct *sct )
{
	sct->head	 = ASL_VAL_FNC_ZOOMROT
					| ( src->bank & ASL_MSK_BANKSEL );
	sct->cntl	 = 0;
	sct->dsp_x_pos	 = ( dstX - ( (int)( src->x_hot ) * scale ) / 256 )
							& ASL_MSK_DSP_X_POS;
	sct->dsp_y_pos	 = ( dstY - ( (int)( src->y_hot ) * scale ) / 256 )
							& ASL_MSK_DSP_Y_POS;
	sct->dsp_xy_size = ( ( ( ( (int)src->x_size * (int)scale ) / 256 - 1 )
				<< ASL_SFT_DSP_X_SIZE ) & ASL_MSK_DSP_X_SIZE )
			 | ( ( ( ( (int)src->y_size * (int)scale ) / 256 - 1 )
				<< ASL_SFT_DSP_Y_SIZE ) & ASL_MSK_DSP_Y_SIZE );
	sct->src_xy_pos	 =
		  ( (  src->x_pos << ASL_SFT_SRC_X_POS ) & ASL_MSK_SRC_X_POS )
		| ( (  src->y_pos << ASL_SFT_SRC_Y_POS ) & ASL_MSK_SRC_Y_POS );
	sct->src_xy_size =
		  ( ( ( src->x_size - 1 ) << ASL_SFT_SRC_X_SIZE )
							& ASL_MSK_SRC_X_SIZE )
		| ( ( ( src->y_size - 1 ) << ASL_SFT_SRC_Y_SIZE )
							& ASL_MSK_SRC_Y_SIZE );
	sct->src_x_off	 = 0;
	sct->src_y_off	 = 0;
	sct->src_x_scan	 = 65536 / (int)scale;
	sct->src_y_scan	 = 0;
}

/*----------------------------------------------------------------------------*/
